package mythesis.gui.main.components.api;

import javafx.scene.*;
import javafx.scene.shape.*;
import javafx.scene.paint.*;
import javafx.scene.text.*;
import javafx.scene.input.*;
import javafx.scene.image.*;

public class MenuButton extends CustomNode
{
    var defaultFill = "#B3B3D9";
    var clickFill = "#000000";
    var hoverFill = "#D8D8E8";
    public var icon = "";
    public var help = "";
    
    var curFill = defaultFill;
    
    override public function create() : Node
    {
        return Group
        {
        	content:
        	[

        		Rectangle
        		{
        		    width     : 25;
        		    height    : 25;
        		    arcHeight : 5;
        		    arcWidth  : 5;
        		    fill      : bind Color.web(curFill);
        		    onMousePressed: function( e: MouseEvent ): Void
        		    				{
        		        				curFill = clickFill;
        		    				}
        		    onMouseReleased: function( e: MouseEvent): Void
        		    				 {
        		        				curFill = defaultFill;
        		    				 }
        		    onMouseEntered: function( e: MouseEvent): Void
        		    				 {
        		        				curFill = hoverFill;
        		    				 }
        		    onMouseExited: function( e: MouseEvent): Void
        		    				 {
        		        				curFill = defaultFill;
        		    				 }
        		}
	        	ImageView
	        	{
	        	    x      : 2
	        	    y      : 1
	        	    image  : Image
	        	    		 {
								url    : icon;
						        width  : 23
						        height : 23
	        	    		 }
	        	    //cache  : true
	        	}
        	]   
        }
    }
}